<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function Girl(name, age) {
            // var obj = new Object; 自动创建对象（实例）
            // 构造函数中用this表示当前创建出来的实例
            this.name = name;
            this.age = age;
            // return obj;  自动返回对象
        }
        Girl.prototype.eat = function () {
            console.log(this.name + '吃麻辣烫');
        }
    </script>
</body>

</html>